var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(f, d, c) {
    if (status == 0 && f == 0) {
        im.dispose();
        return
    }(f == 1) ? status++ : status--;
    selectionLog[status] = c;
    var a = -1;
    if (status <= a++) {
        im.dispose()
    } else {
        if (status === a++) {
            var e = ["领导力", "感性", "洞察力", "意志", "手技", "魅力"];
            var b = im.rand(0, e.length - 1);
            im.addTrait(e[b], 30);
            im.gainItem(im.getItemId(), -1);
            im.playerMessage(5, e[b] + "提高了30点。");
            im.dispose()
        }
    }
};